home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nejlepší hry
/
Nejlepsi hry.iso
/
hry
/
sea of chaos
/
sea_install.msi
/
_15C39AAA7726369D39812BD40F01CF6A
/
_53E77F7F59364ABB8D44E57E485F6FED
< prev
next >
Wrap
Text File
|
2005-04-05
|
796b
|
40 lines
//does lookup into env map and (maybee blends with another given color?)
//color of sky
float4 skyClr;
//texture blob and env map
sampler sampBlob;
sampler sampCube;
//input
struct PS_INPUT
{
float2 Tex : TEXCOORD0;
float3 Env : TEXCOORD1;
};
//shader code
float4 PShader(PS_INPUT In) : COLOR
{
In.Env=normalize(In.Env);
//sample env map and texture
float4 eClr=texCUBE(sampCube,In.Env);
if (In.Env.z<0)
{
float4 water=float4(0.2f,0.15,0.55,0.55f);
eClr=lerp(eClr,water,saturate(-In.Env.z*20.0f));
}
float4 tClr=tex2D(sampBlob,In.Tex);
float3 blueClr=float3(0,0,1);
//blend
float4 clr;
clr.xyz=0.425f*eClr.xyz + 0.4f*skyClr.xyz + 0.125f*blueClr;
clr.a=tClr.a*eClr.a;
return clr;
}